/*
 *  Class which supports the operations of the CheckersState class.
 *  The Move class acts as a node which contains three important pieces of information.
 *  It contains the player moving, the starting point of the move and the destination of the move.
 */

import java.util.LinkedList;

public class Move {
	
	private String player; // Player to be moving
	private int initRow, initCol; //The starting point of the move, both row and column.
	private int destRow, destCol; //The detination point of the move, both row and column.
	private LinkedList<EnemyLocation> enemyList;
	
	public Move(String play, int ix, int iy, int ex, int ey){
		player = play;
		initRow = ix;
		initCol = iy;
		destRow = ex;
		destCol = ey;
		enemyList = new LinkedList<EnemyLocation>();
	}
	
	public String getPlayer(){
		return player;
	}
	
	public int getIntialRow(){
		return initRow;
	}
	
	public int getIntialCol(){
		return initCol;
	}

	public int getDestRow(){
		return destRow;
	}

	public int getDestCol(){
		return destCol;
	}
	
	public boolean isJump(){
		if(!enemyList.isEmpty()){
			return true;
		}
		else
			return false;
	}

	public void enqueueEnemyJump(int x, int y ,int i, int j){
		enemyList.add(new EnemyLocation(x,y,i,j));
	}
	
	public EnemyLocation dequeueEnemyJump(){
		return enemyList.removeFirst();
	}
	
	public boolean isJumpListEmpty(){
		if(enemyList.isEmpty()){
			return true;
		}
		else{
			return false;
		}
	}

	public String toString(){
		return player + ": (" + initRow +"," + initCol + ") to (" + destRow + "," + destCol + ")";
	}
	
}
